import axios from "./axios"

export default {
    // 用户检查是否登录
    isLogin: (data) => {
        return axios({
            method: "post",
            url: "user/checkLogin",
            data
        })
    },
    // ****************************普通员工****************************
    // 添加个人申请
    addApply: (data) => {
        return axios({
            method: "post",
            url: "apply/addOrUpdate",
            data
        })
    },

    // 添加个人考勤
    addcheckwork: (data) => {
        return axios({
            method: "post",
            url: "checkwork/addOrUpdate",
            data
        })
    },
    // 查询个人考勤列表
    myCheckwork: (data) => {
        return axios({
            method: "post",
            url: "checkwork/getCheckwork",
            params: {
                "pageNo": data.pageNo,
                "pageSize": data.pageSize,
            }
        })
    },
    // 查询个人申请列表
    myApply: (data) => {
        return axios({
            method: "post",
            url: "apply/getApply",
            params: {
                "pageNo": data.pageNo,
                "pageSize": data.pageSize,
            }
        })
    },

    // ****************************部门经理****************************
    // 申请列表
    getApplyList2: (data) => {
        return axios({
            method: "get",
            url: "apply/getPage",
            params: {
                "pageNo": data.pageNo,
                "pageSize": data.pageSize,
                "searchTxt": data.searchTxt,
            }
        })
    },
    // 删除申请
    deleteApply: (id) => {
        return axios({
            method: "delete",
            url: "apply/delete/" + id,
        })
    },

    // 考勤列表分页
    getcheckworkList: (data) => {
        return axios({
            method: "get",
            url: "checkwork/getPage",
            params: {
                "pageNo": data.pageNo,
                "pageSize": data.pageSize,
                "searchTxt": data.searchTxt,
            }
        })
    },
    // 删除考勤
    deletecheckwork: (id) => {
        return axios({
            method: "delete",
            url: "checkwork/delete/" + id,
        })
    },
}